const {request}=require('./request.js');
// 基于业务封装的数据请求
module.exports={
	
     // console.log(h5文章详情)
  getList:(data)=>{
    return request("/v1/index/article/h5","POST",data,false,{
		  'content-type':'application/x-www-form-urlencoded'
	});
  },
  	// console.log("微信登陆")
	landing:(data)=>{
	  return request("/v1/login-registration/wx","POST",data,false);
	},
	// 获取手机验证码
	verification:(data) =>{
		return request("/v1/code/sms","POST",data,false)
	},
	// 手机号登陆
	disembark:(data) =>{
		return request("/v1/login-registration/phone","POST",data,false)
	},
	// console.log(获取商品列表方法)
	article:(data)=>{
	  return request("/v2/index/article","POST",data,false);
	},
	// 文章判断有没有收藏
	estimate:(data)=>{
	// console.log(获取商品列表方法)
	  return request("/v1/community/article/check/favorites","POST",data,false,{
		  'content-type':'application/x-www-form-urlencoded'
	});
	},
	 // 文章收藏
	collect:(data)=>{
	  // console.log(获取商品列表方法)
	  return request("/v1/community/article/action/favorites","POST",data,false,{
		  'content-type':' application/json'
	});
	},
	// 文章评论列表
	discuss:(data) =>{
		return request("/v1/community/article/comment/page","POST",data,false);
	},
	// 子评论列表
	subcomment:(data) =>{
		return request("/v1/community/article/comment/page/sub","POST",data,false);
	},
	// 判断用户是否关注
	attention:(data) => {
		return request("/v1/user/check/follow","post",data,false,{
		  'content-type':'application/x-www-form-urlencoded'
	})
	},
	// 用户关注
	concern:(data) => {
		return request("/v1/user/follow","post",data,false,{
			 'content-type':'application/x-www-form-urlencoded'
		})
	},
	// 取消关注
	unfollow:(data) => {
		return request("/v1/user/un-follow","post",data,false,{
			 'content-type':'application/x-www-form-urlencoded'
		})
	},
	// 文章评论点赞
	upvote:(data) => {
		return request("/v1/community/article/comment/article/thumbsUp","post",data,false,{
			'content-type':'application/x-www-form-urlencoded'
		})
	},
	// 文章评论取消点赞
	callpvote:(data) => {
		return request("/v1/community/article/comment/article/unThumbsUp","post",data,false,{
			'content-type':'application/x-www-form-urlencoded'
		})
	},
	// 用户评论点赞
	cpovet:(data) => {
		return request("/v1/community/article/comment/user/thumbsUp","post",data,false,{
			'content-type':'application/x-www-form-urlencoded'
		})
	},
	// 用户评论取消点赞
	callcpon:(data) => {
		return request("/v1/community/article/comment/user/unThumbsUp","post",data,false,{
			'content-type':'application/x-www-form-urlencoded'
		})
	},
	// 文章评论
	essayist:(data) => {
		return request("/v1/community/article/action/comment","post",data,false)
	},
	// 用户评论
	useryist:(data) => {
		return request("/v1/community/article/action/comment/user","post",data,false)
	},
	// 收藏判断
	judgment:(data) => {
		return request("/v1/community/article/check/favorites","post",data,false,{
			'content-type':'application/x-www-form-urlencoded'
		})
	},
	// 点赞判断
	Liking:(data) => {
		return request("/v1/community/article/check/thumbs-up","post",data,false,{
			'content-type':'application/x-www-form-urlencoded'
		})
	},
	// 文章点赞
	giveat:(data) => {
		return request("/v1/community/article/action/thumbs-up","post",data,false)
	},
	// 装修知识
	knowledge:(data) =>{
		return request("/v1/community/article/knowledge/index","POST",data,false);
	},
	// 装修避坑
	jumpding:(data) => {
		return request("/v1/community/article/misunderstanding/index","post",data,false)
	},
	// 经典案例
	clastey:(data) => {
		return request("/v1/community/article/classic-case/index","post",data,false)
	},
	// 商品列表
	merchandise:(data) =>{
		return request("/v1/commodity/index","POST",data,false);
	},
	// 商品详细
	merchan:(data) =>{
		return request("/v1/commodity/detail","POST",data,false,{
		  'content-type':' application/x-www-form-urlencoded'
	});
	},
     // 添加购物车
	addshopping:(data) => {
		return request("/v1/shop-cart/add","POST",data,false);
	},
	// 数量增加
	addition:(data) => {
		return request("/v1/shop-cart/incr","post",data,false)
	},
	// 数量减少
	subtraction:(data) => {
		return request("/v1/shop-cart/decr","post",data,false)
	},
	// 商品收藏
	collection:(data) => {
		return request("/v1/commodity/favorites/add","post",data,false)
	},
	// 取消收藏
	canceltion:(data) => {
		return request("/v1/commodity/favorites/cancel","post",data,false,{
		  'content-type':' application/x-www-form-urlencoded'
	})
	},
	// 购物车列表
	trolley:(data) => {
		return request("/v1/shop-cart/list","post",data,false)
	},
	// 购物车删除
	hdelete:(data) => {
		return request("/v1/shop-cart/remove","post",data,false)
	},
	// 文章足迹
	xfootprint:(data) => {
		return request("/v1/community/article/footprint/list","post",data,false)
	},
	// 文章搜藏列表
	xhide:(data) => {
		return request("/v1/community/article/favorites/index","post",data,false)
	},
	// 文章首屏搜索
	xdiscover:(data) => {
		return request("/v1/index/search","post",data,false)
	},
	// 获取轮播图
	xslideshow:(data) => {
		return request("/v1/index/banner/list","get",data,false)
	}
}

